package com.amar.dtadmin.apidoc.action;

import com.amar.dtadmin.apidoc.ui.dialog.DtAdminSettingsDialog;
import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import org.jetbrains.annotations.NotNull;

/**
 * @author xiaoshiqiang
 * @since 2025/2/9
 */
public class DtAdminSettingAction extends AnAction {

    @Override
    public void actionPerformed(AnActionEvent e) {
        new DtAdminSettingsDialog(e.getProject()).show();
    }

    @Override
    public void update(@NotNull AnActionEvent e) {
        super.update(e);
        e.getPresentation().setEnabledAndVisible(e.getProject() != null);
    }

    @Override
    public @NotNull ActionUpdateThread getActionUpdateThread() {
        return ActionUpdateThread.BGT;
    }

}
